import request from '@/axios/request'
import url from '@/axios/url'
const { mesUrl, adminUrl, wmsUrl } = url()
// 导出url
export const exportUrl = `${mesUrl}mesProdOrder/export`

/**
 * 新增
 * @param data
 * @returns {*|Promise<*>}
 */
export function reinspectionPartCreate(data = '') {
  return request({
    url: `${mesUrl}reinspection/parts/c`,
    method: 'post',
    data: data
  })
}
export function reinspectionDescCreate(data = '') {
  return request({
    url: `${mesUrl}reinspection/desc/c`,
    method: 'post',
    data: data
  })
}
export function reinspectionRepairCreate(data = '') {
  return request({
    url: `${mesUrl}reinspection/repair/c`,
    method: 'post',
    data: data
  })
}

/**
 * 修改
 * @param data
 * @returns {*|Promise<*>}
 */
export function reinspectionPartUpdate(data = '') {
  return request({
    url: `${mesUrl}reinspection/parts/u`,
    method: 'post',
    data: data
  })
}
export function reinspectionDescUpdate(data = '') {
  return request({
    url: `${mesUrl}reinspection/desc/u`,
    method: 'post',
    data: data
  })
}
export function reinspectionRepairUpdate(data = '') {
  return request({
    url: `${mesUrl}reinspection/repair/u`,
    method: 'post',
    data: data
  })
}

/**
 * 分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function reinspectionPartPage(data = {}) {
  return request({
    url: `${mesUrl}reinspection/parts/page`,
    method: 'get',
    params: data
  })
}
export function reinspectionDescPage(data = {}) {
  return request({
    url: `${mesUrl}reinspection/desc/page`,
    method: 'get',
    params: data
  })
}
export function reinspectionRepairPage(data = {}) {
  return request({
    url: `${mesUrl}reinspection/repair/page`,
    method: 'get',
    params: data
  })
}

/**
 * 不分页
 * @param data
 * @returns {*|Promise<*>}
 */
export function reinspectionPartList(data = {}) {
  return request({
    url: `${mesUrl}reinspection/parts/list`,
    method: 'get',
    params: data
  })
}
export function reinspectionDescList(data = {}) {
  return request({
    url: `${mesUrl}reinspection/desc/list`,
    method: 'get',
    params: data
  })
}
export function reinspectionRepairList(data = {}) {
  return request({
    url: `${mesUrl}reinspection/repair/list`,
    method: 'get',
    params: data
  })
}
/**
 * 删除
 * @param id
 * @returns {*|Promise<*>}
 */
export function reinspectionPartDeleteById(id = '') {
  return request({
    url: `${mesUrl}reinspection/parts/d/${id}`,
    method: 'post'
  })
}
export function reinspectionDescDeleteById(id = '') {
  return request({
    url: `${mesUrl}reinspection/desc/d/${id}`,
    method: 'post'
  })
}
export function reinspectionRepairDeleteById(id = '') {
  return request({
    url: `${mesUrl}reinspection/repair/d/${id}`,
    method: 'post'
  })
}
